package part07_组合模式_学校院系展示;

/**
 * @ClassName: Client
 * @Author: AllenSun
 * @Date: 2020/3/2 20:53
 */
public class Client {
    public static void main(String[] args) {
        //从大到小创建对象
        //创建大学
        OrganizationComponent universty=new Universty("清华大学","中国顶尖大学");
        //创建学院
        OrganizationComponent college1=new College("计算机学院","最赚钱的学院");
        OrganizationComponent college2=new College("工程学院","工程学院");
        OrganizationComponent college3=new College("文学院","文学院");
        OrganizationComponent college4=new College("外国语学院","外国语学院");
        //创建各个学院下面的专业
        college1.add(new Department("软件工程","软件工程不错"));
        college1.add(new Department("网络工程","网络工程不错"));
        college1.add(new Department("通信工程","通信工程不错"));
        college1.add(new Department("信息安全","信息安全不错"));
        college2.add(new Department("土木工程","土木工程不错"));
        college3.add(new Department("中国文学","中国文学不错"));
        college3.add(new Department("外国文学","外国文学不错"));
        college4.add(new Department("外交学","外交学不错"));
        college4.add(new Department("国际关系学","国际关系学不错"));

        //把学院加到大学里
        universty.add(college1);
        universty.add(college2);
        universty.add(college3);
        universty.add(college4);

        //输出
        System.out.println("打印整个大学");
        universty.print();
        System.out.println("打印计算机学院");
        college1.print();
    }
}
